package com.jsite.modules.test.web;

import com.jsite.common.lang.StringUtils;
import com.jsite.common.web.BaseController;
import com.jsite.modules.test.entity.DemoData;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by GAOLEI on 2019/8/8.
 */
@Controller
@RequestMapping(value = "${adminPath}/demo")
public class DemoController extends BaseController {
    /**
     * Form
     */
    @RequiresPermissions("test:testData:view")
    @RequestMapping(value = "form/{viewName}")
    public String form(@PathVariable String viewName,  DemoData testData, Model model) {
        model.addAttribute("testData",testData);
        return "modules/demo/demoForm" + StringUtils.cap(viewName);

    }
}
